import QtQuick 2.0
import Qt3D 1.0
import Qt3D.Shapes 1.0
import "js/BlockInfo.js" as BI

Item3D{
    id: _root

    property int textureMode: 0     //0:pastel 1:normal 2:curse

    signal startGame()

    Quad{
        id: _titleLogo
        y: 0.5
        scale: 8
        effect: Effect {
            blending: true
            texture: "Images/textureTitleLogo.png"
        }
        transform: [
            Rotation3D{ angle: 90; axis: Qt.vector3d(1, 0, 0) }
        ]
    }
    Quad{
        y: -2.2
        z: 1
        scale: 1
        effect: Effect {
            blending: true
            texture: "Images/textureMenuMode.png"
        }
        transform: [
            Rotation3D{ angle: 90; axis: Qt.vector3d(1, 0, 0) }
        ]
    }
    Quad{
        y: -3
        z: 1.1
        scale: 2
        effect: Effect {
            blending: true
            texture: "Images/textureMenuPastel.png"
        }
        transform: [
            Rotation3D{ angle: 90; axis: Qt.vector3d(1, 0, 0) }
        ]
    }
    Quad{
        y: -4
        z: 1.2
        scale: 2
        effect: Effect {
            blending: true
            texture: "Images/textureMenuCurse.png"
        }
        transform: [
            Rotation3D{ angle: 90; axis: Qt.vector3d(1, 0, 0) }
        ]
    }

    TitleCursor{
        id: _cursor
        y: -3
        z: 1

        enabled: _root.enabled
        cursorColor: "#ffffff" //"#101090"
    }

    //キーイベント処理
    function keyEvent(event){
        switch(event.key){
        case Qt.Key_Up:
            textureMode = 0;
            break;
        case Qt.Key_Down:
            textureMode = 1;
            break;

        case Qt.Key_Enter:
        case Qt.Key_Return:
            _root.startGame();
            break;

        default:
            break;
        }
    }

    StateGroup{
        states: [
            State{
                when: textureMode == 1
                PropertyChanges {
                    target: _cursor
                    y: -4
                    cursorColor: "#ffffff"
                }
            }

        ]
    }
}
